package com.timeDeal.servlet;

import com.timeDeal.bean.UserBean;
import com.timeDeal.service.AdminService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by lenovo on 2016/9/12.
 */
@WebServlet(name = "ChulijieguoServlet")
public class ChulijieguoServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        int yonghuid = Integer.parseInt(request.getParameter("id"));
        String chengfaleixing = request.getParameter("flag");
        AdminService adminService = new AdminService();
        boolean result = adminService.jubaochulijieguo(yonghuid,chengfaleixing);
        System.out.println("AAAAAAAAAAAAAAAAAAAAAAAA");
        if(result) {
            request.setAttribute("yonghuid",yonghuid);
            System.out.println("AAAAAAAAAAAAAAAAAAAAAAAA");
            request.getRequestDispatcher("/admin/jubaochuligg.jsp?currentpage=0").forward(request,response);
        }
    }
}
